package com.kx.center.listener;

import javax.servlet.ServletContext;

import org.springframework.context.ApplicationContext;

public class Context {
	private final static Context instance = new Context();
	private static ServletContext context;
	private static ApplicationContext applicatioContext;

	private Context()
	{
	}
	
	public static Context getInstance()
	{
	   return instance;
	}

	public void setContext(ServletContext context2)
	{
	   context = context2;
	}

	public ServletContext getContext()
	{
	   return context;
	}
	
	public void setApplicationContext(ApplicationContext applicatioContext2){
		applicatioContext = applicatioContext2;
	}
	
	public ApplicationContext getApplicationContext(){
		return applicatioContext;
	}
	
	public Object getBean(String name){
		return applicatioContext.getBean(name);
	}
	
}
